package com.aya.dync;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader;

public class DyncPropBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

        PropertiesBeanDefinitionReader propertiesBeanDefinitionReader
                = new PropertiesBeanDefinitionReader((BeanDefinitionRegistry)beanFactory);
        propertiesBeanDefinitionReader.loadBeanDefinitions("classpath:property/bean-dync.properties");
    }
}
